#ifndef BEZIER_HPP
#define BEZIER_HPP
#include "GLHeaders.hpp"
#include "Vector.hpp"

class Bezier{
	public:
		Vector v0;
		Vector v1;
		Vector v2;
		Vector v3;

	public:
    //////////////////
		//  Constructor //
    //////////////////

		Bezier(
        void);
		Bezier(
				const Vector& vect0,
				const Vector& vect3);
		Bezier(
				const Vector& vect0,
				const Vector& vect1,
				const Vector& vect2,
				const Vector& vect3);
    
    //////////////////
    //  Destructor  //
    //////////////////
    
    ~Bezier(void);
    
    ///////////////////////////
	  // Arithmetic operations //
    ///////////////////////////

    Bezier operator + () const;
    Bezier operator - () const;
    Bezier operator + (const Bezier   &rhs) const;
    Bezier operator + (const Vector &value) const;
    Bezier operator - (const Bezier   &rhs) const;
    Bezier operator - (const Vector &value) const;
    Bezier operator * (const GLfloat value) const;
    Bezier operator / (const GLfloat value) const;

    ////////////////////
    // Friend Methods //
    ////////////////////

    friend Bezier operator + (const Vector &value, const Bezier &rhs);
    friend Bezier operator - (const Vector &value, const Bezier &rhs);
    friend Bezier operator * (const GLfloat value, const Bezier &rhs);
    friend Bezier operator / (const GLfloat value, const Bezier &rhs);

    ////////////////////////
    // Arithmetic updates //
    ////////////////////////

    Bezier& operator  = (const Bezier   &rhs);
    Bezier& operator  = (const Vector &value);
    Bezier& operator += (const Bezier   &rhs);
    Bezier& operator += (const Vector &value);
    Bezier& operator -= (const Bezier   &rhs);
    Bezier& operator -= (const Vector &value);
    Bezier& operator *= (const GLfloat value);
    Bezier& operator /= (const GLfloat value);

    //////////////////////
    // Useful functions //
    //////////////////////

		Vector Position(GLfloat time) const;
		Vector FirstDerivative(GLfloat time) const;		
		Vector SecondDerivative(GLfloat time) const;
		
    //////////////////////
		//  Special Bezier  //
    //////////////////////

		static const Bezier ZERO;
		static const Bezier UNIT_X;
		static const Bezier UNIT_Y; 
		static const Bezier UNIT_Z; 
		static const Bezier NEGATIVE_UNIT_X; 
		static const Bezier NEGATIVE_UNIT_Y; 
		static const Bezier NEGATIVE_UNIT_Z;  
};

#endif
